//
//  CLReadModel.h
//  CLBrowser
//
//  Created by 梁慧聪 on 2022/7/22.
//

#import <Foundation/Foundation.h>
#import "CLReadChapterListModel.h"

NS_ASSUME_NONNULL_BEGIN
@class CLReadRecordModel,CLReadMarkModel;
@interface CLReadModel : CLBook <NSCoding>
@property (nonatomic, copy) NSString *bookName;
/// 小说来源类型
@property (nonatomic, assign) CLBookSourceType bookSourceType;
/// 书签列表
@property (nonatomic, strong) NSMutableArray <CLReadMarkModel *>*markModels;
/// 章节列表(如果是网络小说可以不需要放在这里记录,直接在目录视图里面加载接口或者读取本地数据库就好了。)
@property (nonatomic, strong) NSArray <CLReadChapterListModel *>*chapterListModels;
// MARK: 快速进入

/// 本地小说全文
@property (nonatomic, copy) NSString *fullText;
/// 章节内容范围数组 [章节ID:[章节优先级:章节内容Range]]
@property (nonatomic, strong) NSDictionary *ranges;

// MARK: 辅助

/// 保存
- (void)save;

/// 是否存在阅读对象
+ (BOOL)isExist:(NSString *)bookid;


// MARK: 构造

/// 获取阅读对象,如果则创建对象返回
+ (CLReadModel *)model:(NSString *)bookid;
@end


NS_ASSUME_NONNULL_END
